local function main (userOb, msgData)
    if not msgData.id or not msgData.pops then
        return
    end

    local player = userOb:get_partner(msgData.id)
    if not player then
        local result = {}
        result.code = 400
        userOb:send_packet("MSGS2CPartherArray", result)
        return
    end

    local member_pos = msgData.pops
    local member = userOb:get_combat_partner(member_pos)
    if not member then
        local player_pos = userOb:get_combat_pos(player.id)
        if not player_pos then
            if player.isdie == 1 then
                local result = {}
                result.code = 401
                userOb:send_packet("MSGS2CPartherArray", result)
                return
            end
        else
            ---! 重置出战位置
            PARTNER_D:free_combat_pos(userOb, player_pos)
        end

        ---! 设置出战位置
        PARTNER_D:combat_partner(userOb, player, member_pos)
    else
        local player_pos = userOb:get_combat_pos(player.id)
        if player_pos then
            ---! 交换出战位置
            PARTNER_D:combat_partner(userOb, member, player_pos)
        end

        ---! 设置出战位置
        PARTNER_D:combat_partner(userOb, player, member_pos)
    end

    local result = {}
    result.code = 200
    result.msgData = userOb:get_combat_partners()
    userOb:send_packet("MSGS2CPartherArray", result)
end

--注册方法
COMMAND_D:register_command("MSGC2SPartherArray",GameCmdType.NONE, main)
